
// 注意mock不可与本地存储或pinia结合使用
import { data, getUser, addUser, type userItemInterface } from "./db/mockUserList"
import { data as departData } from "./db/mockUserDepartment"

export default [
    {
        url: '/api/user/list', //请求地址
        method: 'post', //请求方式
        timeout: 500,//延迟时间
        response: ({ body }: { body: userItemInterface }) => {
            addUser(body)
            return { code: 200, data: {}, message: "添加成功" }
        },
    },
    {
        url: '/api/user/list',
        method: 'get',
        response: () => {
            return { code: 200, data: data, message: "获取成功" }
        },
    },
    {
        url: '/api/user/gender',
        method: 'get',
        response: () => {
            return { code: 200, data: [{ label: "男", value: "1" }, { label: "女", value: "2" }], message: "获取成功" }
        },
    },
    {
        url: '/api/user/userDepartment',
        method: 'get',
        response: () => {
            return { code: 200, data: departData, message: "获取成功" }
        },
    },
]

